/*
 * Created by JFormDesigner on Wed May 25 16:28:58 CST 2022
 */

package jw3.c2.view;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * @author Brainrain
 */
public class Home extends JFrame {
    public Home() {
        initComponents();
        setLocation(500,300);
        setSize(790,500);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setVisible(true);
    }

    private void label2MouseClicked(MouseEvent e) {
        // TODO add your code here
        if (JOptionPane.showConfirmDialog(null,
                "是否退出系统?")==0){
        JOptionPane.showMessageDialog(null,"退出系统成功！");
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setVisible(false);
            System.exit(0);
        }
    }

    private void label4MouseClicked(MouseEvent e) {
        // TODO add your code here
        H1 h=new H1();
    }

    private void label7MouseClicked(MouseEvent e) {
        // TODO add your code here
        Bill b=new Bill();
    }

    private void label5MouseClicked(MouseEvent e) {
        // TODO add your code here
        index2 i=new index2();
    }

    private void label3MouseClicked(MouseEvent e) {
        // TODO add your code here
        Cust c=new Cust();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        panel1 = new JPanel();
        label1 = new JLabel();
        label2 = new JLabel();
        panel2 = new JPanel();
        label3 = new JLabel();
        label4 = new JLabel();
        label5 = new JLabel();
        label7 = new JLabel();
        label6 = new JLabel();

        //======== this ========
        setTitle("\u7cfb\u7edf\u4e3b\u754c\u9762");
        setBackground(Color.black);
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //======== panel1 ========
        {
            panel1.setBackground(Color.black);
            panel1.setLayout(null);

            //---- label1 ----
            label1.setText("\u5c71\u5c45\u56fe\u9152\u5e97\u7ba1\u7406\u7cfb\u7edf");
            label1.setBackground(Color.black);
            label1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 14));
            label1.setForeground(new Color(204, 204, 204));
            panel1.add(label1);
            label1.setBounds(new Rectangle(new Point(10, 10), label1.getPreferredSize()));

            //---- label2 ----
            label2.setText("\u9000\u51fa\u7cfb\u7edf");
            label2.setForeground(new Color(153, 255, 255));
            label2.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    label2MouseClicked(e);
                }
            });
            panel1.add(label2);
            label2.setBounds(new Rectangle(new Point(660, 10), label2.getPreferredSize()));

            {
                // compute preferred size
                Dimension preferredSize = new Dimension();
                for(int i = 0; i < panel1.getComponentCount(); i++) {
                    Rectangle bounds = panel1.getComponent(i).getBounds();
                    preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                    preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                }
                Insets insets = panel1.getInsets();
                preferredSize.width += insets.right;
                preferredSize.height += insets.bottom;
                panel1.setMinimumSize(preferredSize);
                panel1.setPreferredSize(preferredSize);
            }
        }
        contentPane.add(panel1);
        panel1.setBounds(0, 0, 780, 40);

        //======== panel2 ========
        {
            panel2.setBackground(new Color(102, 102, 0));
            panel2.setLayout(null);

            //---- label3 ----
            label3.setForeground(Color.white);
            label3.setText("\u5f00\u623f\u7ba1\u7406");
            label3.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    label3MouseClicked(e);
                }
            });
            panel2.add(label3);
            label3.setBounds(new Rectangle(new Point(25, 30), label3.getPreferredSize()));

            //---- label4 ----
            label4.setForeground(Color.white);
            label4.setText("\u5ba2\u6237\u7ba1\u7406");
            label4.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    label4MouseClicked(e);
                }
            });
            panel2.add(label4);
            label4.setBounds(new Rectangle(new Point(25, 245), label4.getPreferredSize()));

            //---- label5 ----
            label5.setForeground(Color.white);
            label5.setText("\u7cfb\u7edf\u8bbe\u7f6e");
            label5.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    label5MouseClicked(e);
                }
            });
            panel2.add(label5);
            label5.setBounds(new Rectangle(new Point(25, 360), label5.getPreferredSize()));

            //---- label7 ----
            label7.setForeground(Color.white);
            label7.setText("\u8425\u4e1a\u67e5\u8be2");
            label7.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    label7MouseClicked(e);
                }
            });
            panel2.add(label7);
            label7.setBounds(new Rectangle(new Point(25, 140), label7.getPreferredSize()));

            {
                // compute preferred size
                Dimension preferredSize = new Dimension();
                for(int i = 0; i < panel2.getComponentCount(); i++) {
                    Rectangle bounds = panel2.getComponent(i).getBounds();
                    preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                    preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
                }
                Insets insets = panel2.getInsets();
                preferredSize.width += insets.right;
                preferredSize.height += insets.bottom;
                panel2.setMinimumSize(preferredSize);
                panel2.setPreferredSize(preferredSize);
            }
        }
        contentPane.add(panel2);
        panel2.setBounds(0, 40, 110, 455);

        //---- label6 ----
        label6.setText("welcome!");
        label6.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 28));
        contentPane.add(label6);
        label6.setBounds(380, 210, 180, 65);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JPanel panel1;
    private JLabel label1;
    private JLabel label2;
    private JPanel panel2;
    private JLabel label3;
    private JLabel label4;
    private JLabel label5;
    private JLabel label7;
    private JLabel label6;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
